from sentence_transformers import SentenceTransformer
from transformers import AutoModel, AutoTokenizer
class Embedding:
    def __init__(self):

        self.model = AutoModel.from_pretrained('../huggingface/paraphrase-multilingual-mpnet-base-v2')
    def get_embedding(self, text: str) -> list:
        '''文本转词向量'''
        embeddings = self.model.encode(text)
        return list(embeddings)
        